<?php defined( '_JEXEC') or die; //no direct access ?>
    <script type="text/javascript" src="audio-player/audio-player.js"></script>
		<script type="text/javascript">
			AudioPlayer.setup("/joomla/audio-player/player.swf", {
				width: 290
			});
		</script>
	<script type="text/javascript" src="mp3player/js/swfobject.js">
    </script>
    <script type="text/javascript">
        // JAVASCRIPT VARS
        // cache buster
        var cacheBuster = "?t=" + Date.parse(new Date());

        // swf path
        var swfPath = "http://localhost:85/joomla/mp3player/preview.swf";
        //swfPath += cacheBuster; // uncomment this line to activate the cache buster

        // stage dimensions
        var stageW = 281; //560;//"100%";
        var stageH = 78; //300;//"100%";

        // ATTRIBUTES
        var attributes = {};
        attributes.id = 'FlabellComponent';
        attributes.name = attributes.id;

        // PARAMS
        var params = {};
        params.allowfullscreen = "true";
        params.allowScriptAccess = "always";
        params.bgcolor = "#ffffff";
        params.wmode = "transparent";


        /* FLASH VARS */
        var flashvars = {};

        /// if commented / delete these lines, the component will take the stage dimensions defined 
        /// above in "JAVASCRIPT SECTIONS" section or those defined in the settings xml			
        flashvars.componentWidth = stageW - 1; //281; // define these dimensions different then the stage dimension only for preview because the component is samller then the stage
        flashvars.componentHeight = stageH - 1; //78;
        /// path to the content folder(where the xml files, images or video are nested)
        /// if you want to use absolute paths(like "http://domain.com/images/....") then leave it empty("")
        flashvars.pathToFiles = "";
        flashvars.xmlPath = "http://localhost:85/joomla/mp3player/player/xml/settings.xml";

        // other vars
        flashvars.artistName = "Gippsland History";
        flashvars.songName = "<?php echo $this->file->name; ?>";
        flashvars.songURL = "<?php echo $this->linkToFile; ?>";


        /** EMBED THE SWF**/
        swfobject.embedSWF(swfPath, attributes.id, stageW, stageH, "9.0.124", "http://localhost:85/joomla/mp3player/js/expressInstall.swf", flashvars, params);
    </script>
    <div class="subhead">
        <h3 class="heading">
            <a name="content"></a>
            Audio's Detail:
        </h3>
        <table border="0" cellpadding="0" cellspacing="0">
            <tr>
                <th align="left" width="25%">
                    Name
                </th>
                <td>
                    <?php echo $this->
                        file->name; ?>
                    <input type="button" value="Download" onclick="window.location='<?php echo JRoute::_('index.php?option=com_volunteer&task=downloadfile&fileId=' . $this->file->id); ?>';"
                    />
                </td>
            </tr>
            <tr>
				<td colspan="2" align="left">
                    <object class="playerpreview" type="application/x-shockwave-flash" data="components/player_mp3_mini.swf"
                    width="200" height="20">
                        <param name="movie" value="components/player_mp3_mini.swf" />
                        <param name="bgcolor" value="#492F92" />
                        <param name="FlashVars" value="mp3=<?php echo $this->linkToFile; ?>" />
                    </object>
					<br/>
					<div id="FlabellComponent"></div>
					<br/>
					<p id="audioplayer_1">Alternative content</p>
					<script type="text/javascript">
					AudioPlayer.embed("audioplayer_1", {soundFile: "<?php echo $this->linkToFile; ?>",
						titles: "FileNameHere",
						height: 200,
						autostart: "no",
						width: 600
					});
					</script>
                </td>
            </tr>
            <tr>
                <th align="left">
                    Location
                </th>
                <td>
                    <?php echo $this->
                        location; ?>
                </td>
            </tr>
            <tr>
                <th align="left">
                    Timespan
                </th>
                <td>
                    <?php echo $this->
                        timespan; ?>
                </td>
            </tr>
            <tr>
                <th align="left">
                    Industry
                </th>
                <td>
                    <?php echo $this->
                        industry; ?>
                </td>
            </tr>
            <tr>
                <?php if(sizeof($this->
                    keywords) > 0): ?>
                    <tr>
                        <th align="left">
                            Keywords
                        </th>
                        <td>
                            <?php foreach($this->
                                keywords as $keyword) : ?>
                                <a href="<?php echo JRoute::_('index.php?option=com_normal&location=-1&timespan=-1&industry=-1&keywords=' . $keyword); ?>">
                                <?php echo $keyword; ?>
                                </a>
                                &nbsp;&nbsp;&nbsp;
                                <?php endforeach;?>
                        </td>
                    </tr>
                    <?php endif; ?>
                        <tr>
                            <th align="left">
                                Description
                            </th>
                            <td>
                                <div class="scroll">
                                    <p>
                                        <?php echo $this->
                                            file->description; ?>
                                    </p>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <a target="_blank" href="<?php echo JRoute::_('index.php?option=com_normal&view=filedetail&content=acknowledgement&fileId=' . $this->file->id); ?>">View Acknowledment</a>&nbsp;&nbsp;&nbsp;
								<a target="_blank" href="<?php echo JRoute::_('index.php?option=com_normal&view=feedback&&fileId=' . $this->file->id); ?>">Write a comment</a>&nbsp;&nbsp;&nbsp;
                            </td>
                        </tr>
        </table>
        <fieldset>			
            <legend>
                <h3>
                    Let us know what you think about this file
                </h3>
            </legend>
            <form action="<?php echo JRoute::_('index.php?option=com_volunteer&task=addfeedback'); ?>"
            method="POST">
                <input type="hidden" name="fileId" value="<?php echo JRequest::getVar('fileId'); ?>"
                />
                Your name:
                <br />
                <input type="text" name="name" value="<?php echo $this->name; ?>" />
                <br/>
                Comment:
                <br/>
                <textarea name="feedback" cols="40" rows="">
                    <?php echo $this->
                        feedback; ?>
                </textarea>
                <br/>
                <input type="submit" value="Leave a feedback" />
				<input type="button" value="Close" onClick="javascript:window.close();" />
            </form>
        </fieldset>
    </div>